<template>
  <div class="q-pa-md q-gutter-sm">
    <t-button label="最大化" color="primary" @click="dialog = true" />

    <t-dialog
      v-model:show="dialog"
      persistent
      :maximized="maximizedToggle"
      transition-show="slide-up"
      transition-hide="slide-down"
    >
      <t-card>
        <t-bar>
          <t-space />

          <t-button dense flat icon="minimize" @click="maximizedToggle = false" :disable="!maximizedToggle">
            <t-tooltip v-if="maximizedToggle" class="bg-white text-primary">缩小</t-tooltip>
          </t-button>
          <t-button dense flat icon="crop_square" @click="maximizedToggle = true" :disable="maximizedToggle">
            <t-tooltip v-if="!maximizedToggle" class="bg-white text-primary">最大化</t-tooltip>
          </t-button>
          <t-button dense flat icon="close" @click="dialog = false">
            <q-tooltip class="bg-white text-primary">关闭</q-tooltip>
          </t-button>
        </t-bar>

        <t-card-section>
          <div class="text-h6">我是弹出层的标题</div>
        </t-card-section>

        <t-card-section class="q-pt-none">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis perferendis totam, ea at omnis vel numquam exercitationem aut, natus minima, porro labore.
        </t-card-section>
      </t-card>
    </t-dialog>
  </div>
</template>

<script>
import { ref } from 'vue'

export default {
  setup () {
    return {
      dialog: ref(false),
      maximizedToggle: ref(true)
    }
  }
}
</script>
